package per.chy.stard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import per.chy.stard.entity.Standard;
import per.chy.stard.mapper.StandInfoMapper;
import per.chy.stard.service.StandService;


@Service("stds")
public class StandServiceImpl implements StandService {
	
	@Autowired
	private StandInfoMapper sim;

	@Override
	public List<Standard> findStandInfo() {
		return sim.findStandInfo();
	}

	@Override
	public Standard showStandById(Integer id) {
		return sim.showStandById(id);
	}

	@Override
	public int added(Standard std) {
		return sim.added(std);
	}

	@Override
	public int update(Standard std) {
		return sim.update(std);
	}

	@Override
	public int delete(Integer id) {
		return sim.delete(id);
	}

	@Override
	public int getTotalCountLikeName(String likeName) {
		if(likeName==null||"".equals(likeName)){
			return sim.getTotalCount();
		}
		return sim.getTotalCountLikeName(likeName);
	}

	@Override
	public List<Standard> findByPageLikeName(String likeName, Integer pageNo,
			Integer pageSize) {
		if(likeName==null||"".equals(likeName)){
			return sim.findByPage(pageNo, pageSize);
		}
			return sim.findByPageLikeName(likeName, pageNo, pageSize);
	}

}
